<% if user_signed_in? %>
  <ul class="nav navbar-nav">
    <%= render 'sufia/admin/menu' if can? :read, :admin_dashboard %>
    <li class="dropdown">
      <%= link_to sufia.dashboard_index_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
        <span class="fa fa-tachometer"></span> <%= t("sufia.toolbar.dashboard.menu") %> <span class="caret"></span>
      <% end %>
      <ul class="dropdown-menu">
        <li><%= link_to t("sufia.toolbar.dashboard.my"), sufia.dashboard_index_path %></li>
        <li class="divider"></li>
        <li><%= link_to t("sufia.toolbar.dashboard.transfers"), sufia.transfers_path %></li>
        <li class="divider"></li>
        <li><%= link_to t("sufia.toolbar.dashboard.highlights"), sufia.dashboard_highlights_path %></li>
        <li><%= link_to t("sufia.toolbar.dashboard.shares"), sufia.dashboard_shares_path %></li>
      </ul>
    </li>

    <% if can_ever_create_works? %>
      <li class="dropdown">
        <%= link_to sufia.dashboard_works_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
          <span class="fa fa-cube"></span> <%= t("sufia.toolbar.works.menu") %> <span class="caret"></span>
        <% end %>
        <ul class="dropdown-menu">
          <li><%= link_to t("sufia.toolbar.works.my"), sufia.dashboard_works_path %></li>

          <% classification = CurationConcerns::QuickClassificationQuery.new(current_user) %>
          <% classification.each do |concern| %>
            <li><%= link_to(
                  "#{t("sufia.toolbar.works.new")} #{concern.human_readable_type}",
                  new_polymorphic_path([main_app, concern]),
                  class: "item-option contextual-quick-classify #{dom_class(concern, 'new').gsub('_', '-')}",
                  role: 'menuitem'
                ) %>
            </li>
          <% end %>
          <li><%= link_to t("sufia.toolbar.works.batch"), sufia.new_batch_upload_path %></li>
        </ul>
      </li>
    <% end %>

    <% if can?(:create, Collection) %>
      <li class="dropdown">
        <%= link_to sufia.dashboard_collections_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
          <span class="fa fa-cubes"></span> <%= t("sufia.toolbar.collections.menu") %> <span class="caret"></span>
        <% end %>
        <ul class="dropdown-menu">
          <li><%= link_to t("sufia.toolbar.collections.my"), sufia.dashboard_collections_path %></li>
          <li><%= link_to t("sufia.toolbar.collections.new"), main_app.new_collection_path %></li>
        </ul>
      </li>
    <% end %>
  </ul>
<% end %>
